const cookie =new Cookie
$.ajax({
    url:'./json/lol.json',
    dataType:'json',
    success:function(res){
        let str=''
  
        res.loldaoju.forEach(elem => {
          str+=` <div class="product-img">
          <img src="${elem.img}" alt="">
          <a href="" class="djname">
              <strong>${elem.name}</strong>
          </a>
          <div class="bxlist-t1">
              Q币价：
              <span class="t2 fwb">&nbsp;&nbsp;&nbsp;${elem.qprice}</span>
              <span class="t2 fwb">Q币</span>
          </div>
          <div class="bxlist-t1">
              微信价：
              <span class="t2 fwb">&nbsp;&nbsp;&nbsp;¥</span>
              <span class="t2 fwb">${elem.vprice}</span>
          </div>
          <div class="bxlist-t2">
              <a href="./xiangqing.html?id=${elem.id}" class="btn-green buy-now" title="立即购买">立即购买</a>
          </div>
      </div>`
          
        });
        $(".product-left").append(str)
        }
    
})

$('.right-top a:first').on('click',function(){
    $('.dengl').show()
})
$('.header').click(function(){
    $('.dengl').hide()
})

$('.submit1').click(function(){
    $.ajax({
        url:"./php/login.php",
        type:'post',
        dataType:'json',
        data:{
            username:$('.zhanghao123').val(),
            password:$('.password').val()
        },
        success:function(res){
        if(res){
            location.reload()
            cookie.set(res.username,res.password,300)
        }
        }
    })
})


